/* --------------------------整体页面样式 */
/* ---------------body样式 */
body {
    overflow-x: hidden;
    min-width: 320px;
    max-width: 540px;
    margin: 0 auto;
    background-color: #f2f2f2;
    color: #000;
    font: normal 16px/1.5 PingFangSC-regular,Tahoma,Lucida Grande,Verdana,Microsoft Yahei,STXihei,hei;
    /* 特殊样式 */
    -webkit-tap-highlight-color: transparent;
}

/* ---------------通用样式 */
ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
a {
    text-decoration: none;
    color: #222;
}
div {
    box-sizing: border-box;
}

/* --------------------------搜索栏模块 */
.search-box {
    display: flex;
    /* 固定定位与父容器无关，它以屏幕为参照物 */
    position: fixed;
    top: 0;
    /* 居中 */
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    /* 固定定位必须有宽度：百分比宽度、限制范围 */
    width: 100%;
    /* 固定定位参照屏幕而不是参照body，故需要重新指定范围 */
    min-width: 320px;
    max-width: 540px;
    height: 44px;
    background-color: #f6f6f6;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

.search-input {
    position: relative;
    flex: 1;
    height: 26px;
    margin: 7px 10px;
    padding-left: 30px;
    border: 1px solid #ccc;
    color: #666;
    font-size: 12px;
    /* 因为CSS3盒子模型，添加了边框后导致内容压缩，所以要居中需要：行高小于父容器高度 */
    line-height: 24px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}
.search-input::before {
    content: "";
    /* 父相子绝 */
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 15px;
    /* 二倍精灵图 */
    background: url(../images/jd-sprites.png) no-repeat -80px 0;
    background-size: 200px 200px;
}

.user {
    width: 44px;
    height: 42px;
    background-color: #d4c0a5;
    font-size: 12px;
    color: #2a5eed;
    text-align: center;
}
.user::before {
    content: "";
    display: block;
    width: 23px;
    height: 23px;
    /* 二倍精灵图：暂时用京东的 */
    background: url(../images/jd-sprites.png) no-repeat;
    background-position: -125px -32px;
    background-size: 200px auto;
    margin: 4px auto -2px auto;
}

/* -----------------------------------焦点图模块 */
.focus {
    padding-top: 44px;
}
.focus img {
    width: 100%;
}

/* ------------------------------------导航栏 */
/* -----------------局部导航栏 */
.local-nav {
    display: flex;
    height: 64px;
    background-color: #fff;
    margin: 3px 4px;
    border-radius: 8px;
}

.local-nav li {
    flex: 1;
}

.local-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
}

ul.local-nav li a span[class^="local-nav-icon"] {
    width: 32px;
    height: 32px;
    margin-top: 8px;
    /* background-color: purple; */
    background: url(../images/nav-sprites01.png) no-repeat;
    background-position: 0 0;
    background-size: 32px auto;
    border-radius: 16px;
}
ul.local-nav li a span.local-nav-icon02 {
    /* y坐标：32的倍数 */
    background-position-y: -32px;
}
ul.local-nav li a span.local-nav-icon03 {
    background-position-y: -64px;
}
ul.local-nav li a span.local-nav-icon04 {
    background-position-y: -96px;
}
ul.local-nav li a span.local-nav-icon05 {
    background-position-y: -128px;
}

/* -----------------主导航栏 */
.nav {
    /* 隐藏溢出，子容器就不会遮盖父容器的圆角边框了 */
    overflow: hidden;
    margin: 0 4px 3px;
    border-radius: 8px;
}

.nav-common {
    display: flex;
    height: 88px;
    background-color: skyblue;
}
.nav-common:nth-child(2) {
    margin: 4px 0;
}

.nav-items {
    flex: 1;
    /* 嵌套弹性布局，不会冲突 */
    display: flex;
    flex-direction: column;
}
.nav-items:nth-child(-n+2) {
    border-right: 1px solid #fff;
}

.nav-items a {
    flex: 1;
    color: #fff;
    font-size: 14px;
    line-height: 44px;
    text-shadow: 1px 1px rgba(0, 0, 0, .2);
    text-align: center;
}
.nav-items a:nth-child(1) {
    border-bottom: 1px solid #fff;
}
.nav-items:nth-child(1) a {
    border: none;
    background: url(../images/hotel.png) no-repeat bottom center;
    background-size: 60px auto;
}
.nav-common:nth-child(2) .nav-items:nth-child(1) a {
    background: url(../images/flight.png) no-repeat bottom center;
    background-size: 60px auto;
}
.nav-common:nth-child(3) .nav-items:nth-child(1) a {
    background: url(../images/vacation.png) no-repeat bottom center;
    background-size: 60px auto;
}

.nav-common:nth-child(1) {
    /* 背景色：线性渐变 */
    background: -webkit-linear-gradient(left, #ff6a4c, #ff9c46);
}
.nav-common:nth-child(2) {
    background: -webkit-linear-gradient(left, #438eed, #46b3ed);
}
.nav-common:nth-child(3) {
    background: -webkit-linear-gradient(left, #27b3a6, #61c255);
}

/* -----------------侧导航栏 */
.subnav-entry {
    display: flex;
    /* 子元素设置百分比宽度，挤满一行父容器宽度后就会换行 */
    flex-wrap: wrap;
    margin: 0 4px;
    padding: 5px 0;
    border-radius: 8px;
    background-color: #fff;
}
.subnav-entry li {
    /* 参照父容器宽度 */
    flex: 20%;
}

.subnav-entry a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
}

.subnav-entry-icon {
    width: 28px;
    height: 28px;
    margin-top: 4px;

    /* background: url(../images/temp/weekend.png) no-repeat;
    background-size: 28px auto; */

    /* background: url(../images/temp/nav-sprites02.png) no-repeat;
    background-position: 0 0;
    background-size: 31px auto; */
}
ul.subnav-entry li:nth-child(1) .subnav-entry-icon {
    background: url(../images/temp/weekend.png) no-repeat;
    background-size: 28px auto;
}
ul.subnav-entry li:nth-child(2) .subnav-entry-icon {
    background: url(../images/temp/ticket.png) no-repeat;
    background-size: 28px auto;
}
ul.subnav-entry li:nth-child(n+3) .subnav-entry-icon {
    background: url(../images/temp/shop.png) no-repeat;
    background-size: 28px auto;
}

/* ----------------------------------------热门销售 */
.sales-box {
    margin: 4px;
    /* 避免被底部栏遮盖 */
    margin-bottom: 49px;
    border-top: 1px solid #bbb;
    background-color: #fff;
}
.sales-hd {
    position: relative;
    height: 44px;
    border-bottom: 1px solid #ccc;
}
/* seo优化 */
.sales-hd h2 {
    position: relative;
    text-indent: -999px;
    overflow: hidden;
}
.sales-hd h2::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 20px;
    width: 79px;
    height: 20px;
    background: url(../images/more.png) no-repeat;
    background-size: 79px auto;
}

.more {
    position: absolute;
    top: 0;
    right: 8px;
    padding: 3px 20px 3px 10px;
    background: -webkit-linear-gradient(left, #ff506c, #ff6bc6);
    border-radius: 15px;
    color: #fff;
}
/* 三角 */
.more::after {
    content: "";
    position: absolute;
    top: 12px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: rotate(45deg);
}

.row {
    display: flex;
}
.row a {
    flex: 1;
    border-bottom: 1px solid #eee;
}
.row a:nth-child(1) {
    border-right: 1px solid #eee;
}
.row a img {
    width: 100%;
}

/* ----------------------------------------底部栏 */
footer {
    position: fixed;
    bottom: 0;

    /* 方案1：左右为0，并且margin-auto，可以实现居中 */
    /* --------- */
    right: 0;
    left: 0;
    margin: 0 auto;
    /* --------- */

    /* 方案2：需要指定宽度，例如百分比宽度，通过计算也可以居中 */
    /* 此方案存在缺陷：百分比宽度导致min-width会失效 */
    /* 顶部搜索栏那里也有此缺陷，要改为左右为0那个方案 */
    /* ------------- */
    /* left: 50%;
    transform: translateX(-50%);
    width: 100%; */
    /* ------------- */

    /* 固定定位参照屏幕而不是参照body，故需要重新指定范围 */
    min-width: 320px;
    max-width: 540px;
}
.tabber {
    display: flex;
    background-color: #fff;
}
.tabber a {
    flex: 1;
    /* 布局嵌套 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 49px;
}

.tabber span[class^="icon-"] {
    width: 32px;
    height: 32px;
    background: url(../images/tabbar.png) no-repeat;
    background-size: 32px auto;
}
/* 注意权重问题 */
.tabber span.icon-community {
    background-position: 0 -32px;
}
.tabber span.icon-message {
    background-position-y: -64px;
}
.tabber span.icon-profile {
    background-position-y: -96px;
}